
_ITG3200_init:

;lib_itg3200.c,7 :: 		void ITG3200_init() {
;lib_itg3200.c,11 :: 		I2C1_Start();
	CALL        _I2C1_Start+0, 0
;lib_itg3200.c,12 :: 		I2C1_Wr(ITG3200_WRITE_ADDR);      // Write mode
	MOVLW       210
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_itg3200.c,13 :: 		I2C1_Wr(0x3E);
	MOVLW       62
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_itg3200.c,14 :: 		I2C1_Stop();
	CALL        _I2C1_Stop+0, 0
;lib_itg3200.c,15 :: 		I2C1_Start();
	CALL        _I2C1_Start+0, 0
;lib_itg3200.c,16 :: 		I2C1_Wr(ITG3200_READ_ADDR);       // Read Mode
	MOVLW       211
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_itg3200.c,17 :: 		temp = I2C1_Rd(0);
	CLRF        FARG_I2C1_Rd_ack+0 
	CALL        _I2C1_Rd+0, 0
	MOVF        R0, 0 
	MOVWF       ITG3200_init_temp_L0+0 
;lib_itg3200.c,18 :: 		I2C1_Stop();
	CALL        _I2C1_Stop+0, 0
;lib_itg3200.c,19 :: 		I2C1_Start();
	CALL        _I2C1_Start+0, 0
;lib_itg3200.c,20 :: 		I2C1_Wr(ITG3200_WRITE_ADDR);      // Write mode
	MOVLW       210
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_itg3200.c,21 :: 		I2C1_Wr(0x3E);
	MOVLW       62
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_itg3200.c,22 :: 		I2C1_Wr(((temp & 0xF1) | 0x03));
	MOVLW       241
	ANDWF       ITG3200_init_temp_L0+0, 0 
	MOVWF       FARG_I2C1_Wr_data_+0 
	MOVLW       3
	IORWF       FARG_I2C1_Wr_data_+0, 1 
	CALL        _I2C1_Wr+0, 0
;lib_itg3200.c,23 :: 		I2C1_Stop();
	CALL        _I2C1_Stop+0, 0
;lib_itg3200.c,24 :: 		Delay_ms(50);
	MOVLW       4
	MOVWF       R11, 0
	MOVLW       12
	MOVWF       R12, 0
	MOVLW       51
	MOVWF       R13, 0
L_ITG3200_init0:
	DECFSZ      R13, 1, 1
	BRA         L_ITG3200_init0
	DECFSZ      R12, 1, 1
	BRA         L_ITG3200_init0
	DECFSZ      R11, 1, 1
	BRA         L_ITG3200_init0
	NOP
	NOP
;lib_itg3200.c,27 :: 		I2C1_Start();
	CALL        _I2C1_Start+0, 0
;lib_itg3200.c,28 :: 		I2C1_Wr(ITG3200_WRITE_ADDR);      // Write mode
	MOVLW       210
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_itg3200.c,29 :: 		I2C1_Wr(0x15);
	MOVLW       21
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_itg3200.c,30 :: 		I2C1_Wr(0x01);
	MOVLW       1
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_itg3200.c,31 :: 		I2C1_Stop();
	CALL        _I2C1_Stop+0, 0
;lib_itg3200.c,32 :: 		Delay_ms(10);
	MOVLW       156
	MOVWF       R12, 0
	MOVLW       215
	MOVWF       R13, 0
L_ITG3200_init1:
	DECFSZ      R13, 1, 1
	BRA         L_ITG3200_init1
	DECFSZ      R12, 1, 1
	BRA         L_ITG3200_init1
;lib_itg3200.c,35 :: 		I2C1_Start();
	CALL        _I2C1_Start+0, 0
;lib_itg3200.c,36 :: 		I2C1_Wr(ITG3200_WRITE_ADDR);      // Write mode
	MOVLW       210
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_itg3200.c,37 :: 		I2C1_Wr(0x16);
	MOVLW       22
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_itg3200.c,38 :: 		I2C1_Wr(0x1D);
	MOVLW       29
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_itg3200.c,39 :: 		I2C1_Stop();
	CALL        _I2C1_Stop+0, 0
;lib_itg3200.c,40 :: 		Delay_ms(10);
	MOVLW       156
	MOVWF       R12, 0
	MOVLW       215
	MOVWF       R13, 0
L_ITG3200_init2:
	DECFSZ      R13, 1, 1
	BRA         L_ITG3200_init2
	DECFSZ      R12, 1, 1
	BRA         L_ITG3200_init2
;lib_itg3200.c,41 :: 		}
	RETURN      0
; end of _ITG3200_init

_ITG3200_readGyro:

;lib_itg3200.c,43 :: 		void ITG3200_readGyro(float *gyro) {
;lib_itg3200.c,48 :: 		I2C1_Start();
	CALL        _I2C1_Start+0, 0
;lib_itg3200.c,49 :: 		I2C1_Wr(ITG3200_WRITE_ADDR);      // Write mode
	MOVLW       210
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_itg3200.c,50 :: 		I2C1_Wr(0x1D);
	MOVLW       29
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_itg3200.c,51 :: 		I2C1_Stop();
	CALL        _I2C1_Stop+0, 0
;lib_itg3200.c,52 :: 		I2C1_Start();
	CALL        _I2C1_Start+0, 0
;lib_itg3200.c,53 :: 		I2C1_Wr(ITG3200_READ_ADDR);       // Read Mode
	MOVLW       211
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;lib_itg3200.c,54 :: 		for (cnt=0; cnt<6; cnt++) {
	CLRF        ITG3200_readGyro_cnt_L0+0 
L_ITG3200_readGyro3:
	MOVLW       6
	SUBWF       ITG3200_readGyro_cnt_L0+0, 0 
	BTFSC       STATUS+0, 0 
	GOTO        L_ITG3200_readGyro4
;lib_itg3200.c,56 :: 		ack = (cnt<5);
	MOVLW       5
	SUBWF       ITG3200_readGyro_cnt_L0+0, 0 
	MOVLW       1
	BTFSC       STATUS+0, 0 
	MOVLW       0
	MOVWF       FARG_I2C1_Rd_ack+0 
;lib_itg3200.c,57 :: 		gyro_read[cnt] = I2C1_Rd(ack);
	MOVLW       ITG3200_readGyro_gyro_read_L0+0
	MOVWF       FLOC__ITG3200_readGyro+0 
	MOVLW       hi_addr(ITG3200_readGyro_gyro_read_L0+0)
	MOVWF       FLOC__ITG3200_readGyro+1 
	MOVF        ITG3200_readGyro_cnt_L0+0, 0 
	ADDWF       FLOC__ITG3200_readGyro+0, 1 
	BTFSC       STATUS+0, 0 
	INCF        FLOC__ITG3200_readGyro+1, 1 
	CALL        _I2C1_Rd+0, 0
	MOVFF       FLOC__ITG3200_readGyro+0, FSR1L
	MOVFF       FLOC__ITG3200_readGyro+1, FSR1H
	MOVF        R0, 0 
	MOVWF       POSTINC1+0 
;lib_itg3200.c,54 :: 		for (cnt=0; cnt<6; cnt++) {
	INCF        ITG3200_readGyro_cnt_L0+0, 1 
;lib_itg3200.c,58 :: 		}
	GOTO        L_ITG3200_readGyro3
L_ITG3200_readGyro4:
;lib_itg3200.c,59 :: 		I2C1_Stop();
	CALL        _I2C1_Stop+0, 0
;lib_itg3200.c,61 :: 		gyro_int[0] = gyro_read[0];
	MOVF        ITG3200_readGyro_gyro_read_L0+0, 0 
	MOVWF       ITG3200_readGyro_gyro_int_L0+0 
	MOVLW       0
	MOVWF       ITG3200_readGyro_gyro_int_L0+1 
;lib_itg3200.c,62 :: 		gyro_int[0] = gyro_int[0] << 8;
	MOVF        ITG3200_readGyro_gyro_int_L0+0, 0 
	MOVWF       ITG3200_readGyro_gyro_int_L0+1 
	CLRF        ITG3200_readGyro_gyro_int_L0+0 
;lib_itg3200.c,63 :: 		gyro_int[0] |= gyro_read[1];
	MOVF        ITG3200_readGyro_gyro_read_L0+1, 0 
	IORWF       ITG3200_readGyro_gyro_int_L0+0, 1 
	MOVLW       0
	IORWF       ITG3200_readGyro_gyro_int_L0+1, 1 
;lib_itg3200.c,64 :: 		gyro_int[1] = gyro_read[2];
	MOVF        ITG3200_readGyro_gyro_read_L0+2, 0 
	MOVWF       ITG3200_readGyro_gyro_int_L0+2 
	MOVLW       0
	MOVWF       ITG3200_readGyro_gyro_int_L0+3 
;lib_itg3200.c,65 :: 		gyro_int[1] = gyro_int[1] << 8;
	MOVF        ITG3200_readGyro_gyro_int_L0+2, 0 
	MOVWF       ITG3200_readGyro_gyro_int_L0+3 
	CLRF        ITG3200_readGyro_gyro_int_L0+2 
;lib_itg3200.c,66 :: 		gyro_int[1] |= gyro_read[3];
	MOVF        ITG3200_readGyro_gyro_read_L0+3, 0 
	IORWF       ITG3200_readGyro_gyro_int_L0+2, 1 
	MOVLW       0
	IORWF       ITG3200_readGyro_gyro_int_L0+3, 1 
;lib_itg3200.c,67 :: 		gyro_int[2] = gyro_read[4];
	MOVF        ITG3200_readGyro_gyro_read_L0+4, 0 
	MOVWF       ITG3200_readGyro_gyro_int_L0+4 
	MOVLW       0
	MOVWF       ITG3200_readGyro_gyro_int_L0+5 
;lib_itg3200.c,68 :: 		gyro_int[2] = gyro_int[2] << 8;
	MOVF        ITG3200_readGyro_gyro_int_L0+4, 0 
	MOVWF       ITG3200_readGyro_gyro_int_L0+5 
	CLRF        ITG3200_readGyro_gyro_int_L0+4 
;lib_itg3200.c,69 :: 		gyro_int[2] |= gyro_read[5];
	MOVF        ITG3200_readGyro_gyro_read_L0+5, 0 
	IORWF       ITG3200_readGyro_gyro_int_L0+4, 1 
	MOVLW       0
	IORWF       ITG3200_readGyro_gyro_int_L0+5, 1 
;lib_itg3200.c,71 :: 		gyro[0] = (float)(gyro_int[0] / 14.375);
	MOVF        FARG_ITG3200_readGyro_gyro+0, 0 
	MOVWF       FLOC__ITG3200_readGyro+0 
	MOVF        FARG_ITG3200_readGyro_gyro+1, 0 
	MOVWF       FLOC__ITG3200_readGyro+1 
	MOVF        ITG3200_readGyro_gyro_int_L0+0, 0 
	MOVWF       R0 
	MOVF        ITG3200_readGyro_gyro_int_L0+1, 0 
	MOVWF       R1 
	CALL        _Int2Double+0, 0
	MOVLW       0
	MOVWF       R4 
	MOVLW       0
	MOVWF       R5 
	MOVLW       102
	MOVWF       R6 
	MOVLW       130
	MOVWF       R7 
	CALL        _Div_32x32_FP+0, 0
	MOVFF       FLOC__ITG3200_readGyro+0, FSR1L
	MOVFF       FLOC__ITG3200_readGyro+1, FSR1H
	MOVF        R0, 0 
	MOVWF       POSTINC1+0 
	MOVF        R1, 0 
	MOVWF       POSTINC1+0 
	MOVF        R2, 0 
	MOVWF       POSTINC1+0 
	MOVF        R3, 0 
	MOVWF       POSTINC1+0 
;lib_itg3200.c,72 :: 		gyro[1] = (float)(gyro_int[1] / 14.375);
	MOVLW       4
	ADDWF       FARG_ITG3200_readGyro_gyro+0, 0 
	MOVWF       FLOC__ITG3200_readGyro+0 
	MOVLW       0
	ADDWFC      FARG_ITG3200_readGyro_gyro+1, 0 
	MOVWF       FLOC__ITG3200_readGyro+1 
	MOVF        ITG3200_readGyro_gyro_int_L0+2, 0 
	MOVWF       R0 
	MOVF        ITG3200_readGyro_gyro_int_L0+3, 0 
	MOVWF       R1 
	CALL        _Int2Double+0, 0
	MOVLW       0
	MOVWF       R4 
	MOVLW       0
	MOVWF       R5 
	MOVLW       102
	MOVWF       R6 
	MOVLW       130
	MOVWF       R7 
	CALL        _Div_32x32_FP+0, 0
	MOVFF       FLOC__ITG3200_readGyro+0, FSR1L
	MOVFF       FLOC__ITG3200_readGyro+1, FSR1H
	MOVF        R0, 0 
	MOVWF       POSTINC1+0 
	MOVF        R1, 0 
	MOVWF       POSTINC1+0 
	MOVF        R2, 0 
	MOVWF       POSTINC1+0 
	MOVF        R3, 0 
	MOVWF       POSTINC1+0 
;lib_itg3200.c,73 :: 		gyro[2] = (float)(gyro_int[2] / 14.375);
	MOVLW       8
	ADDWF       FARG_ITG3200_readGyro_gyro+0, 0 
	MOVWF       FLOC__ITG3200_readGyro+0 
	MOVLW       0
	ADDWFC      FARG_ITG3200_readGyro_gyro+1, 0 
	MOVWF       FLOC__ITG3200_readGyro+1 
	MOVF        ITG3200_readGyro_gyro_int_L0+4, 0 
	MOVWF       R0 
	MOVF        ITG3200_readGyro_gyro_int_L0+5, 0 
	MOVWF       R1 
	CALL        _Int2Double+0, 0
	MOVLW       0
	MOVWF       R4 
	MOVLW       0
	MOVWF       R5 
	MOVLW       102
	MOVWF       R6 
	MOVLW       130
	MOVWF       R7 
	CALL        _Div_32x32_FP+0, 0
	MOVFF       FLOC__ITG3200_readGyro+0, FSR1L
	MOVFF       FLOC__ITG3200_readGyro+1, FSR1H
	MOVF        R0, 0 
	MOVWF       POSTINC1+0 
	MOVF        R1, 0 
	MOVWF       POSTINC1+0 
	MOVF        R2, 0 
	MOVWF       POSTINC1+0 
	MOVF        R3, 0 
	MOVWF       POSTINC1+0 
;lib_itg3200.c,74 :: 		}
	RETURN      0
; end of _ITG3200_readGyro
